import {Routes, RouterModule} from '@angular/router';
import {ModuleWithProviders} from '@angular/core';
import {GroupComponent} from './group.component';
import {GrouplistComponent} from './list/grouplist.component';
import {AddComponent} from './add/add.component';
import { AddLotteryComponent } from './add/add-lottery/add-lottery.component';
import { EditComponent } from './edit/edit.component';
import { EditLotteryComponent } from './edit/edit-lottery/edit-lottery.component';
import { WinnersDetailComponent } from './winners-detail/winners-detail.component';

export const routes: Routes = [
  {
    path: '',
    component: GroupComponent,
    children: [{
      path: '',
      component: GrouplistComponent,
      pathMatch: 'full',
      redirectTo: '/member/group/list',
    }, {
      path: 'list',
      component: GrouplistComponent
    }, {
      path: 'add/:type',
      component: AddComponent
    }, {
      path: 'add/:type/:id',
      component: AddComponent
    }, {
      path: 'add-lottery',
      component: AddLotteryComponent
    }, {
      path: 'add-lottery/:id',
      component: AddLotteryComponent
    }, {
      path: 'edit/:id',
      component: EditComponent
    }, {
      path: 'edit-lottery/:id',
      component: EditLotteryComponent
    }, {
      path: 'winners-detail/:id',
      component: WinnersDetailComponent
    }]
  }
];


export const routing: ModuleWithProviders = RouterModule.forChild(routes);
